import request from '@/utils/request'

// 查询全部仓库列表
export function listAllStorageGoods() {
  return request({
    url: '/storage/goods/listAll',
    method: 'get'
  })
}


// 分页查询仓库商品列表
export function listStorageGoods(query) {
  return request({
    url: '/storage/goods/pageList',
    method: 'get',
    params: query
  })
}

// 查询仓库商品详细
export function getStorageGoods(id) {
  return request({
    url: '/storage/goods/query/' + id,
    method: 'get'
  })
}

// 新增仓库商品
export function addStorageGoods(data) {
  return request({
    url: '/storage/goods/add',
    method: 'post',
    data: data
  })
}

// 修改仓库商品
export function updateStorageGoods(data) {
  return request({
    url: '/storage/goods/edit',
    method: 'put',
    data: data
  })
}

// 删除仓库商品
export function delStorageGoods(ids) {
  return request({
    url: '/storage/goods/remove/' + ids,
    method: 'delete'
  })
}

export function updateStorageGoodsPrice(data) {
  return request({
    url: '/storage/goods/updatePrice',
    method: 'post',
    data
  })
}

export function updateStorageGoodsStatus(data) {
  return request({
    url: '/storage/goods/freezeOrActivation',
    method: 'post',
    data
  })
}

export function warningList(params) {
  return request({
    url: '/storage/goods/warningList',
    params
  })
}

export function warningUpdate(data) {
  return request({
    url: '/storage/goods/warningUpdate',
    method: 'post',
    data
  })
}
